using System;
using System.Reflection;

internal sealed class Dictionary<TKey, TValue> { }

public sealed class Program {
   public static void Main() {

      // Get a reference to the generic Type 
      Type openType = typeof(Dictionary<,>);

      // Close the generic type using TKey=String, TValue=Int32
      Type closedType = openType.MakeGenericType(
         new Type[] { typeof(String), typeof(Int32) });

      // Construct an instance of the closed type
      Object o = Activator.CreateInstance(closedType);

      // Prove it worked
      Console.WriteLine(o.GetType());
   }
}
